package cn.life.common.support.datasource;

public class DataSourceContextHolder {

    private static final ThreadLocal<DataSourceType> local = new ThreadLocal<DataSourceType>();

    public static ThreadLocal<DataSourceType> getLocal() {
        return local;
    }

    public static void setDataSource(DataSourceType type) {
        local.set(type);
    }

    public static DataSourceType getDataSource() {
        return local.get();
    }

    public static void clear() {
        local.remove();
    }

}
